package cn.changeforyou.tcpIp.analysis.demo.protocol.gbt32960_3.enums;

import io.netty.util.AsciiString;

/**
 * @author zhyu
 * @date 2020/8/7 15:57
 */
public enum  TotalCarInfoEnums {

    car_status_startup("车辆状态-启动", new AsciiString("01"), EnumTypes.car_status),
    car_status_shutdown("车辆状态-熄火", new AsciiString("02"), EnumTypes.car_status),
    car_status_other("车辆状态-其他", new AsciiString("03"), EnumTypes.car_status),
    car_status_error("车辆状态-异常", new AsciiString("FE"), EnumTypes.car_status),
    car_status_none("车辆状态-无效", new AsciiString("FF"), EnumTypes.car_status),

    recharge_status_stop("充电状态-停车充电", new AsciiString("01"), EnumTypes.recharge_status),
    recharge_status_drving("充电状态-行驶充电", new AsciiString("02"), EnumTypes.recharge_status),
    recharge_status_no("充电状态-未充电状态", new AsciiString("03"), EnumTypes.recharge_status),
    recharge_status_ok("充电状态-充电完成", new AsciiString("04"), EnumTypes.recharge_status),
    recharge_status_error("充电状态-异常", new AsciiString("FF"), EnumTypes.recharge_status),
    recharge_status_none("充电状态-无效", new AsciiString("FF"), EnumTypes.recharge_status),
    ;

    TotalCarInfoEnums(String describle, AsciiString word, EnumTypes type) {
        this.describle = describle;
        this.word = word;
        this.type = type;
    }

    public static final String car_status = "sdadsa";

    private String describle;
    private AsciiString word;
    private EnumTypes type;

    public static TotalCarInfoEnums getByWord(CharSequence word) {
        if (null == word) {
            return null;
        }
        TotalCarInfoEnums[] values = TotalCarInfoEnums.values();
        for (TotalCarInfoEnums value : values) {
            if (value.word.equals(word)) {
                return value;
            }
        }
        return null;
    }

    public String getDescrible() {
        return describle;
    }

    public AsciiString getWord() {
        return word;
    }
}
